import java.util.Scanner;

/**
 * @author gao
 * @date 2025/11/14 16:17
 */

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        while (in.hasNext()) {
            int n = in.nextInt();
            in.nextLine();
            char[][] matrix = new char[n][n];
            for (int i = 0; i < n; i++) {
                matrix[i] = in.next().toCharArray();
            }

            // 计算二维前缀和
            int[][] prefix = new int[n + 1][n + 1];
            for (int i = 1; i <= n; i++) {
                for (int j = 1; j <= n; j++) {
                    int val = matrix[i - 1][j - 1] - '0';
                    prefix[i][j] = prefix[i - 1][j] + prefix[i][j - 1] - prefix[i - 1][j - 1] + val;
                }
            }

            for (int i = 1; i <= n; i++) {
                if (i % 2 != 0) {
                    System.out.println(0);
                    continue;
                }

                int count = 0;
                // 完美矩阵中区域和
                int targetSum = (i * i) / 2;

                // 遍历子矩阵
                for (int r = 1; r <= n - i + 1; r++) {
                    for (int c = 1; c <= n - i + 1; c++) {
                        // 子矩阵的右下角坐标
                        int r2 = r + i - 1;
                        int c2 = c + i - 1;

                        // 使用前缀和
                        int curSum = prefix[r2][c2] - prefix[r - 1][c2] - prefix[r2][c - 1] + prefix[r- 1][c - 1];
                        if (curSum == targetSum) {
                            count++;
                        }
                    }
                }
                System.out.println(count);
            }
        }
    }
}